<template>
  <LayoutContainer>
    <UiLoadingPanel v-if="pending" />
    <div v-else>
      <h2> EducationTiming</h2>
      <UiForm
        ref="form"
        :model="EducationTiming"
        :entity="education_timings"
        :submitActions="submitActions"
      >
      <UiInputNumber field="educationtiming" v-model="education_timings.timing" />
      </UiForm>
    </div>
  </LayoutContainer>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { useEntityFetch } from '~/composables/data/useEntityFetch'
import EducationTiming from '~/models/Education/EducationTiming';
import { useRoute } from 'vue-router'
import { useI18n } from 'vue-i18n'
import {AnyJson} from "~/types/data";
import {SUBMIT_TYPE} from "~/types/enum/enums";

const goBackRoute = { path: `/parameters`, query: { tab: 'educationTimings' } }

const i18n = useI18n()
const { fetch } = useEntityFetch()
const route = useRoute()
const id = ref(route.params.id)
console.log(id.value) 

const submitActions = computed(() => {
  let actions: AnyJson = {}
  actions[SUBMIT_TYPE.SAVE_AND_BACK] = goBackRoute
  return actions
})


const {data : education_timings, pending} = fetch(EducationTiming, id.value)
console.log(education_timings)


</script>
